//
//  LLBViewController.m
//  LLBTestKit
//
//  Created by Spaino on 10/20/2019.
//  Copyright (c) 2019 Spaino. All rights reserved.
//

#import "LLBViewController.h"
#import <LLBShowViewController.h>
//#import <UIView+VLAdditions.h>
//#import <LLBTestObject.h>

@interface LLBViewController ()

@end

@implementation LLBViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//	NSLog(@"%lf", self.view.width);
//
//	[LLBTestObject log];
	
	[self setupSubviews];
}

- (void)setupSubviews {
	CGFloat sWidth = UIScreen.mainScreen.bounds.size.width;
	CGFloat sHeight = UIScreen.mainScreen.bounds.size.height;
	[self.view addSubview:({
		CGFloat cWidth = 150;
		CGFloat lMargin = (sWidth - cWidth)/2.0;
		CGFloat tMargin = (sHeight - 50)/2.0;
		UIButton *tButton = [[UIButton alloc] initWithFrame:CGRectMake(lMargin, tMargin, cWidth, 50)];
		tButton.titleLabel.font = [UIFont systemFontOfSize:22];
		[tButton setBackgroundColor:[UIColor lightGrayColor]];
		[tButton setTitle:@"打开页面" forState:UIControlStateNormal];
		[tButton setTitle:@"打开页面" forState:UIControlStateHighlighted];
		[tButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
		[tButton setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted];
		[tButton addTarget:self action:@selector(showAction) forControlEvents:UIControlEventTouchUpInside];
		tButton;
	})];
}

- (void)showAction {
	[LLBShowViewController show];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
